<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>React - propType</title>
	<script src="../build/react.js"></script>
	<script src="../build/react-dom.js"></script>
	<script src="../build/browser.min.js"></script>
</head>
<body>
	<div id="container"></div>
	<div id="container2"></div>
	<script type="text/babel">
		var data = 'cattle';
		var MyTitle = React.createClass({
			propTypes: {
				title: React.PropTypes.string.isRequired,
			},
			render: function(){
				return <h1> { this.props.title } </h1>
			}
		});
		ReactDOM.render(
			<MyTitle title={data} />,
			document.getElementById('container')
		)


		var DefaultProp = React.createClass({
			getDefaultProps: function(){
				return {
					title: 'cattle2'
				}
			},
			render: function(){
				return <h1> {this.props.title} </h1>
			}
		})
		ReactDOM.render(<DefaultProp />, document.getElementById('container2'))

	</script>

</body>
</html>